package com.genius.reservation.user.service;

import com.alibaba.fastjson.JSONObject;
import com.genius.reservation.common.ResponseRule;
import com.genius.reservation.receiver.entity.ReceiverInformation;
import com.genius.reservation.user.entity.UserInformation;
import com.baomidou.mybatisplus.extension.service.IService;
import org.apache.ibatis.annotations.Select;
import org.springframework.web.bind.annotation.RequestParam;

/**
 * <p>
 * 用户表 服务类
 * </p>
 *
 * @author baomidou
 * @since 2022-05-28
 */
public interface IUserInformationService extends IService<UserInformation> {
    //根据userNumber获取
    UserInformation getUserByUserNumber(String userNumber);

    //修改用户信息
    JSONObject updateUserByUserNumber(String userNumber);

    default UserInformation addAndUp(UserInformation entity){
        this.saveOrUpdate(entity);
        return entity;
    }

    //注册
    @Deprecated
    ResponseRule registerUser(UserInformation user);

    ResponseRule editUser(UserInformation user);

    ResponseRule loginUser(String wxNumber);

    ResponseRule modifyPassword(String oldpassword,  String password,  String tpassword,String userNumber);

    UserInformation login2(String userNumber,String userPassword);
    ResponseRule registerUser(String userNumber,String userPassword,String wxOpenId,String nickName,String avatar,String phone);

    default UserInformation createUser(UserInformation user){
        this.saveOrUpdate(user);
        return user;
    }
}
